From: Florian Müllner Date: Thu, 5 Jun 2025 13:33:16 +0000 (+0200) Subject: timeLimitsManager: Pass extra transition options as params X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~124^2^2~67 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ecf36632deb220d68b7da3c527b797f34847b728;p=gnome-shell.git timeLimitsManager: Pass extra transition options as params Boolean parameters are often harder to grasp, in particular when there are multiple. So before adding more optional flags to `_addTransition()`, pass flags as a params object. Part-of: --- diff --git a/js/misc/timeLimitsManager.js b/js/misc/timeLimitsManager.js index dc4590584..dd189e285 100644 --- a/js/misc/timeLimitsManager.js +++ b/js/misc/timeLimitsManager.js @@ -455,7 +455,8 @@ export const TimeLimitsManager = GObject.registerClass({ } } - _addTransition(oldState, newState, wallTimeSecs, recalculateState = true) { + _addTransition(oldState, newState, wallTimeSecs, + {recalculateState = true} = {}) { this._stateTransitions.push({ oldState, newState, @@ -542,8 +543,9 @@ export const TimeLimitsManager = GObject.registerClass({ this._addTransition( entry['oldState'], entry['newState'], - entry['wallTimeSecs'], - i === history.length - 1); + entry['wallTimeSecs'], { + recalculateState: i === history.length - 1, + }); previousWallTimeSecs = entry['wallTimeSecs']; }